cmake_minimum_required(VERSION 3.0.0)
project(mxt VERSION 0.1.0)
set(Mxt_VERSION_MARJOR 1)
set(Mxt_VERSION_MINOR 0)

# should we use our own math functions?
option (USE_MYMATH
        "Use tutorial provided math implementation" ON)

configure_file(
    "${PROJECT_SOURCE_DIR}/MxtConfig.h.in"
    "${PROJECT_SOURCE_DIR}/MxtConfig.h"
)

# add the MathFunctions library?
#
if (USE_MYMATH)
    include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
    add_subdirectory (MathFunctions)
    set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
endif (USE_MYMATH)


include(CTest)
enable_testing()

add_executable(mxt main.cpp)

target_link_libraries (mxt  ${EXTRA_LIBS})



set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)


# add the install targets
install (TARGETS mxt DESTINATION bin)
install (FILES "${PROJECT_BINARY_DIR}/MxtConfig.h"
        DESTINATION include)